From 945249f2ee26472e45814dafa0b5bf980c0035f3 Mon Sep 17 00:00:00 2001 From: justbur Date: Wed, 22 Jul 2015 10:47:07 -0400 Subject: [PATCH] Fix #50 - Don't show pages if only 1 page --- which-key.el | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/which-key.el b/which-key.el index 0964defe89e..f58a88abf94 100644 --- a/which-key.el +++ b/which-key.el @@ -956,13 +956,24 @@ enough space based on your settings and frame size." prefix-keys) (prefix-left (s-pad-right first-col-width " " prefix-w-face)) (status-left (s-pad-right first-col-width " " status-left)) new-end lines) - (cond ((eq which-key-show-prefix 'left) + (cond ((and (< 1 n-pages) + (eq which-key-show-prefix 'left)) (setq lines (split-string page "\n") first (concat prefix-left (car lines) "\n" status-left) new-end (concat "\n" (s-repeat first-col-width " ")) page (concat first (mapconcat #'identity (cdr lines) new-end)))) + ((eq which-key-show-prefix 'left) + (if (= 1 height) + (setq page (concat prefix-left page)) + (setq lines (split-string page "\n") + first (concat prefix-left (car lines) "\n" (s-repeat first-col-width " ")) + new-end (concat "\n" (s-repeat first-col-width " ")) + page (concat first (mapconcat #'identity (cdr lines) new-end))))) + ((and (< 1 n-pages) + (eq which-key-show-prefix 'top)) + (setq page (concat prefix-w-face "- " status-top "\n" page))) ((eq which-key-show-prefix 'top) - (setq page (concat prefix-w-face "- " status-top "\n" page)))) + (setq page (concat prefix-w-face "- \n" page)))) (which-key--lighter-status n-shown n-tot) (if (eq which-key-popup-type 'minibuffer) (let (message-log-max) (message "%s" page)) -- 2.30.2